import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/css/global.css'
import axios from 'axios'
import TreeTable from 'vue-table-with-tree-grid'

axios.defaults.baseURL="https://lianghj.top:8888/api/private/v1/"
// 设置请求拦截器对请求进行预处理
axios.interceptors.request.use(config=>{
  // 在访问有权限的API时，要用请求头携带Authorization参数值，才能请求成功，它的值是token
  config.headers.Authorization=window.sessionStorage.getItem('token');
  //在最后必须返回config
  return config;
})
Vue.prototype.$http=axios
Vue.config.productionTip = false
Vue.component('tree-table', TreeTable)

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
